<?php
/**
 * Created by PhpStorm.
 * User: andrei
 * Date: Jun 27, 2012
 * Time: 4:13:31 PM
 * To change this template use File | Settings | File Templates.
 */
 
class Db_Products_ProductPageImages extends Common {
	protected static $tableName = TAB_PRODUCT_PAGE_IMAGES;
	protected static $dbFields = array(
        'id',
		'ppi_product_page_id',
		'ppi_layout_item_id',
		'ppi_photo_id',
		'ppi_iw',
		'ppi_ih',
		'ppi_ir',
		'ppi_ix',
		'ppi_iy',
		'ppi_image_filter',
        'deleted'
	);


	/**
	 * @var Db_Products_ProductPageImages
	 */
	public $objectArray;

	public $id;
	public $ppi_product_page_id;
	public $ppi_layout_item_id;
	public $ppi_photo_id;
	public $ppi_iw;
	public $ppi_ih;
	public $ppi_ir;
	public $ppi_ix;
	public $ppi_iy;
	public $ppi_image_filter;
    public $deleted;

    function __construct($value=NULL, $fieldName=NULL) {
        parent::__construct($value, $fieldName);
    }

	public static function deleteByLiIds($liIds = array()) {
		$liIdsList = implode(',',$liIds);
		self::$DB->q("DELETE FROM ?f WHERE `ppi_layout_item_id` IN( ? ) ;", self::$tableName, $liIdsList);

        return (self::$DB->affectedRows() ? true : false);
	}

}